class Super:
    def __init__(self):
        self.data = [];
        
    def aof(self, x):
        self.data.append(x);

class Clazz(Super):
    def act(self, o):
        self.aof(o);
        return self.data;

def inherit():
    obj = Clazz();
    obj.aof("obj");
    obj.aof("clazz");
    print obj.data;

import threading, time
class RunnableThread(threading.Thread):
    def __init__(self, threadname):
        threading.Thread.__init__(self, name=threadname);
        
    def run(self):
        f_name = str(self.getName() + ".txt");
        f = file(f_name, 'a');
        for i in range(1, 5):
            print self.getName(), " ", i
            time.sleep(1);
            msg = str(self.getName()) + " " + str(i) + "\n";
            f.write(msg);
        f.close();
        
        
def runnable(): 
    for i in range(1, 3):
        t_name = 'thread' + str(i);
        obj = RunnableThread(t_name);
        obj.start();
        time.sleep(1);
        print obj;
        

class empty_class :
    pass  # it's present this statment do nothing
'''class_name variable & Instance variable'''
'''self is the instance reference, like this'''
class class_name:
    class_var = "Class_variable";
    def __init__(self, instance_var):
        self.instance_var = instance_var;
        # print self.instance_var;
     
    def class_method(self): 
        print class_name.class_var;
        print self.instance_var;
        print self.__class__.__name__;
    
'''access control _ and __''' 
def clazz_func():
    clazz = class_name("Instance_variable");
    clazz.class_method();
    print(dir(clazz));

clazz_func();
            
        
        
